<?php
namespace app\index\controller;



use app\common\service\LoadBalancing;
use app\lib\exception\ServiceErrorException;
use app\lib\redis\RedisServer;
use think\Controller;

class Index extends Controller
{
    protected $middleware = [
        'ImposeRequest'
    ];


    public function index()
    {

        $load = new LoadBalancing();

        echo $load->balanceAllot();

//        $key = 'update:userId:1';
//
//        $lock = new RedisServer($key);
//
//        try{
//            $lock->aLock();
//            echo '资源没有被锁住!';
//        } finally {
//            $lock->unLock();
//        }
    }

    public function hello($name = 'ThinkPHP5')
    {
        return 'hello,' . $name;
    }

    public function redis() {

    }
}
